﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="LpnSplit.aspx.cs" Inherits="WMS6.Web.Common.LpnSplit" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <link href="../style/zh/1/css.css" type="text/css" rel="Stylesheet" id="mycss" />
    <link href="../Css/style.css" type="text/css" rel="stylesheet" />

    <script src="../Js/util.js" id="js" type="text/javascript"></script>

    <script src="../Js/InitPage.js" type="text/javascript"></script>

    <script language="javascript" type="text/javascript" src="../Js/jquery.js"></script>

    <script language="javascript" type="text/javascript" src="../Js/jquery.blockUI.js"></script>

    <script src="../Js/Verification.js" type="text/javascript"></script>
    
    <base target="_self" />
    <title>LPN拆分</title>

    <script language="javascript">
       //初始化页面
      window.onload = function(){            
            var action = document.getElementById("hdnActionID").value;
            if(action != null && action != "")
            {
                var array = action.split(',');
                initQueryPage(array[0],array[1]);
            }
            else
            {
                initListPage();
            }
            }
         function Impor()
         {
            var blockUIMsg = "<img src='../Images/loading.gif' /> &nbsp;&nbsp;&nbsp;请稍候...";
            //var lang = parent.frames['banner'].document.getElementById("hdnPerfLanguage").value;
            $.blockUI.defaults.message = blockUIMsg;
            $.blockUI.defaults.overlayCSS.backgroundColor = GetBlockUIBgColor();
            $.blockUI();
         }

        function copyToClipBoard() 
        { 
           var clipBoardContent=""; 　　
           clipBoardContent += document.getElementById('divMsg').innerText; 
　　       window.clipboardData.setData("Text",clipBoardContent);   　　
           alert("复制成功,请粘贴到剪切板.");
        }
   
        //打印lpn标签
        function popPrinLpnLabel() 
        {
            var lpnIDs = document.getElementById("hdnLpnIDs").value;
            var OwnerID= document.getElementById("txtOwnerID").value;
            //window.open('../Common/PrintReport.aspx?rtype=PICKLPNLABEL&lpnIDS=' + escape(lpnIDs), 'PrintWindow', 'width=860,height=610,top=50,left=50,toolbar=no,menubar=no,scrollbars=yes, resizable=yes,location=no,status=no');
            window.open('../Common/PrintReport.aspx?rtype=PICKLPNLABEL'+'&OwnerID='+escape(OwnerID), 'PrintWindow', 'width=860,height=610,top=50,left=50,toolbar=no,menubar=no,scrollbars=yes, resizable=yes,location=no,status=no');
        }
        
        //弹出窗口选择货品
        function selectSKU()
        {
            var rtnValue = popModalWindow('../Configuration/SKUQuery.aspx?action=txtSkuIDStart','dialogWidth=800px;dialogHeight=500px;center=yes;resizable=yes;status=no;');
            if(rtnValue != null && rtnValue.toString() != "")
            {
                document.getElementById("txtSkuIDStart").focus();
                document.getElementById("txtSkuIDStart").value = rtnValue;
            }
        }
        
        //弹出窗口选择货主
        function selectOwner()
        {
            var rtnValue = popModalWindow('../Configuration/OwnerQuery.aspx?action=txtOwnerID','dialogWidth=800px;dialogHeight=500px;center=yes;resizable=yes;status=no;');
            if(rtnValue != null && rtnValue.toString() != "")
            {
                document.getElementById("txtOwnerID").focus();
                document.getElementById("txtOwnerID").value = rtnValue;
            }
        }
        
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table width="520" align="center" cellpadding="0" cellspacing="0">
            <tr>
                <td align="center" valign="bottom">
                    <asp:Label ID="Label2" runat="server" CssClass="label_header" Text="LPN拆分" meta:resourcekey="Label2"></asp:Label>
                </td>
            </tr>
            <tr>
                <td>
                    <table width="360" cellpadding="0" cellspacing="0" align="center" style="margin: 10px 0">
                        <tr>
                            <td>
                                <asp:Label ID="lblMsg" runat="server" class="label_message" meta:resourcekey="lblMsg"></asp:Label>
                            </td>
                            <td>
                            </td>
                            <td>
                            </td>
                        </tr>
                        <tr>
                            <td width="180px">
                                <asp:Label ID="lblLpnID" runat="server" class="label" Text="Lpn" meta:resourcekey="Label1"></asp:Label>
                            </td>
                            <td width="180px">
                             <asp:Label ID="lblOwnerID" runat="server" class="label" Text="货主代码" meta:resourcekey="Label1"></asp:Label>
                                </td>
                            <td>
                            </td>
                        </tr>
                        <tr>
                            <td width="180px">
                                <asp:TextBox ID="txtLpnID" runat="server" Enabled="false"></asp:TextBox>
                            </td>
                            <td>
                             <asp:TextBox ID="txtOwnerID" runat="server" Enabled="false"></asp:TextBox><img src="../Images/icon_find.gif" alt="select one item" class="img" onclick="selectOwner();"/>
                            </td>
                            <td>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="lblQty" runat="server" class="label" Text="数量" meta:resourcekey="Label1"></asp:Label>
                            </td>
                            <td>
                              <asp:Label ID="lblSkuID" runat="server" class="label" Text="货品代码" meta:resourcekey="Label1"></asp:Label>
                                </td>
                            <td>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:TextBox ID="txtQty" runat="server" Enabled="false" ></asp:TextBox>
                            </td>
                            <td> 
                            <asp:TextBox ID="txtSkuID" runat="server" Enabled="false" ></asp:TextBox><img src="../Images/icon_find.gif" alt="select one item" class="img" onclick="selectSKU();"/>
                            </td>
                            <td>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="lblSplitQty" runat="server" class="label" Text="拆分数量" meta:resourcekey="Label1"></asp:Label>
                            </td>
                            <td>
                               <asp:Label ID="lblLotAttr01" runat="server" class="label" Text="版本号" meta:resourcekey="Label1"></asp:Label>
                            </td>
                            <td>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:TextBox ID="txtSplitQty" runat="server" Text="" MaxLength="9" onblur="JavaScript:dataVer._Is123(this,'lblMsg')" ></asp:TextBox>
                            </td>
                            <td>
                               <asp:TextBox ID="txtLotAttr01" runat="server" Text="" Enabled="false" ></asp:TextBox>
                            </td>
                            <td>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="lblCount" runat="server" class="label" Text="拆分个数" meta:resourcekey="Label1"></asp:Label><font class="must_input">*</font>
                            </td>
                            <td>
                            </td>
                            <td>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:TextBox ID="txtCount" runat="server" Text="" MaxLength="4"  onblur="JavaScript:dataVer._Is123(this,'lblMsg')"></asp:TextBox>
                            </td>
                            <td>
                                <asp:Button ID="btnSplit" runat="server" OnClick="btnSplit_Click" CssClass="button" Text="拆分" />
                            </td>
                            <td>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="3">
                                <asp:GridView ID="gvLpn" runat="server" AutoGenerateColumns="False" CssClass="gridview"
                                    Width="350px" AllowSorting="True" onrowdatabound="gvLpn_RowDataBound"
                                    meta:resourcekey="gvSku">
                                    <FooterStyle CssClass="GridViewFooterStyle" />
                                    <RowStyle CssClass="GridViewRowStyle" />
                                    <HeaderStyle CssClass="GridViewHeaderStyle" />
                                    <AlternatingRowStyle CssClass="GridViewAlternatingRowStyle" />
                                    <Columns>
                                        <asp:BoundField HeaderText="序号" FooterText="序号" >
                                            <ItemStyle CssClass="GridViewRowWidth_100" />
                                        </asp:BoundField>
                                            <asp:TemplateField FooterText="Lpn" HeaderText="Lpn">
                                            <ItemTemplate>
                                                <asp:Label ID="lblLpn" runat="server" Text='<%# Eval("LpnID").ToString() %>'></asp:Label>
                                            </ItemTemplate>
                                            <ItemStyle CssClass="GridViewRowWidth_150" />
                                        </asp:TemplateField>                                     
                                        <asp:TemplateField FooterText="数量" HeaderText="数量">
                                            <ItemTemplate>
                                                <asp:TextBox ID="txtQty" runat="server" Text='<%# GetPreferenceDigit(Eval("Qty").ToString()) %>'></asp:TextBox>
                                            </ItemTemplate>
                                            <ItemStyle CssClass="GridViewRowWidth_150" />
                                        </asp:TemplateField>
                                    </Columns>
                                </asp:GridView>
                            </td>
                        </tr>
                        <tr height="10px">
                        <td colspan="3"></td></tr>
                        <tr>
                            <td colspan="3">
                                <asp:Button ID="btnGenerate" runat="server" OnClientClick="Impor(); return true"  visible="false"
                                    OnClick="btnGenerate_Click" CssClass="button" Text="<%$Resources:ButtonResource,btnConfirm%>" />
                                <input type="button" onclick="javascript:  window.close();" id="btnCancel" runat="server" visible="false"
                                    class="button" value="<%$Resources:ButtonResource,btnGoBack%>" />
                                <asp:Button ID="btnPrint" runat="server" visible="false"
                                    OnClick="btnPrint_Click" CssClass="button" Text="打印标签" />
                            </td>
                        </tr>
                        <tr>
                            <td colspan="3">
                                <div id="divMsg" runat="server" style="cursor: hand; margin-top: 10px; border: solid 1px #fcfcfc"
                                    onclick="copyToClipBoard();" onmouseover="document.getElementById('divMsg').style.border = 'solid 1px #C5D1FF';"
                                    onmouseout="document.getElementById('divMsg').style.border = 'solid 1px #fcfcfc';">
                                </div>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
        <input type="hidden" id="hdnActionID" runat="server" />
        <input type="hidden" id="hdnLpnIDs" runat="server" />
    </div>
    </form>
</body>
</html>
